package com.eden.manage.controller;

import com.eden.manage.req.LoginReq;
import com.eden.manage.service.LoginService;
import eden.api.common.model.EdenResult;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("login")
@RequiredArgsConstructor
public class LoginController {

    private final LoginService loginService;


    @PostMapping("")
    public  EdenResult<?> login(@RequestBody LoginReq loginReq){
        String login = loginService.login(loginReq.getAccount(), loginReq.getPassword());
        return EdenResult.ok(login);
    }


}
